﻿using System;
using System.ComponentModel.DataAnnotations;

namespace TaoNiuOA.Models
{
    /// <summary>
    /// 用户详细信息
    /// </summary>
    public class UserInfo
    {
        [Key]
        public int UserInfoID { get; set; }

        [Display(Name = "姓名")]
        public string Name { get; set; }

        [Display(Name = "性别")]
        public bool? Sex { get; set; }

        [Display(Name = "生日")]
        [DisplayFormat(DataFormatString="{0: yyyy-MM-dd}")]
        public DateTime? Birthday { get; set; }

        [Display(Name = "电话")]
        public string Tel { get; set; }

        [Display(Name = "手机")]
        public string Mobile { get; set; }

        [Display(Name = "QQ")]
        public string QQ { get; set; }

        [Display(Name = "MSN")]
        public string Msn { get; set; }

        [Display(Name = "身份证")]
        public string Id { get; set; }

        [Display(Name = "开户银行")]
        public string BankName { get; set; }

        [Display(Name = "银行帐号")]
        public string BankAccount { get; set; }

        //[Display(Name = "照片")]
        //public string Photo { get; set; }

        [Display(Name = "地址")]
        public string Address { get; set; }

        [Display(Name = "邮编")]
        public string Postcode { get; set; }

        public string ShowSex()
        {
            if (this.Sex == null)
                return "未填写";
            else if (Convert.ToBoolean(this.Sex))
                return "男";
            else
                return "女";
        }
    }
}